package com.gst.cloudygovernance.fragment;

import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.Toast;

import com.gst.cloudygovernance.R;
import com.gst.cloudygovernance.adapter.ReportFragmentAdapter;
import com.gst.cloudygovernance.base.BaseFragment;
import com.gst.cloudygovernance.utils.ToastUtil;

/**
 * Created by CHENG on 2017/12/18.
 */

public class ReportFragment extends BaseFragment {

    private GridView gv;

    @Override
    public View initView() {
        View view  = View.inflate(mContext, R.layout.fragment_report,null);
        gv = view.findViewById(R.id.gv);
        //为GridView设置适配器
        ReportFragmentAdapter adapter = new ReportFragmentAdapter(mContext);
        gv.setAdapter(adapter);
        //注册监听事件
        gv.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id)
            {
                ToastUtil.show(getActivity(), "pic" + position, Toast.LENGTH_SHORT);
            }
        });
        return view;
    }

    @Override
    public void initData() {
        super.initData();
    }
}
